]> dgit.raspbian.org Git - gnome-shell.git/commit
st/scroll-bar: Use an StWidget for the handle rather than a button
authorJonas Dreßler <verdre@v0yd.nl>
Sat, 9 Aug 2025 17:40:54 +0000 (19:40 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 28 Aug 2025 17:14:06 +0000 (19:14 +0200)
commit38e05347c0db365fdded8515f5239f6b46f3b104
tree86b29b4a9dd497277cae558bb1b028fe9d9f456d
parentdf2db922172f564b9cef9f1648f7d51fc6415e8d
st/scroll-bar: Use an StWidget for the handle rather than a button

When we'll port the StScrollBar to use the new ClutterPanGesture, the
StButtons internal click gesture would interfere with the :active state of
the handle, because we set it in two places now: Here in StScrollBar, and in
StButton. Due to the order of gesture state changes when the scroll bar
handle pan gesture recognizes and cancels the button click gesture, the
active state will end up not being set during the actual pan.

To fix this, avoid using an StButton for the pan, and instead use a simple
StWidget.

While at it, change the CSS selector to be based on class name, not on ID.
IDs in CSS should be unique, and scroll bar handles are used more than once
in our UI.

Also, because apparently there's a Croco or St CSS parsing bug, select the
.vhandle/.hhandle class using the ">" child selector, as selecting just by
class doesn't do the trick :/

am

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2853>
data/theme/gnome-shell-sass/widgets/_login-lock.scss
data/theme/gnome-shell-sass/widgets/_scrollbars.scss
src/st/st-scroll-bar.c